package org.example.shoppingBrowser.common;

import java.text.SimpleDateFormat;

/**
 * 工具类
 */
public class TimeUtils {
    //获得当前的日期时间
    public static String getLocalDateTime(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
        String localDateTime = sdf.format(System.currentTimeMillis());
        return localDateTime;
    }

    public static String getLocalDate(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String localDate = sdf.format(System.currentTimeMillis());
        return localDate;
    }
}
